package eleventh.StringBuffer类;
//删除使用delete()方法
public class 删除指定范围的字符串 {
    public static void main(String[] args) {
        StringBuffer sb = new StringBuffer();
        sb.append("一去二三里");
        System.out.println(sb);
        sb = sb.delete(0, 2);   //范围：start -- (end-1)
        System.out.println(sb);

    }
}
/*
D:\WorkSpaces\Java\jdk-21\bin\java.exe "-javaagent:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\lib\idea_rt.jar=52616:D:\Software\IntelliJ IDEA\IntelliJ IDEA 2023.3.2\bin" -Dfile.encoding=UTF-8 -Dsun.stdout.encoding=UTF-8 -Dsun.stderr.encoding=UTF-8 -classpath D:\WorkSpaces\JavaDevelopBase_start_329\out\production\JavaDevelopBase_start_329 eleventh.StringBuffer类.删除指定范围的字符串
一去二三里
二三里

Process finished with exit code 0
 */